var app = getApp();
Page({

  /**
   * 页面的初始数据 https://image.chenjianfeng.xyz/20180904140847.png
   */
  data: {
    AlbumGuid:'',
    EwmUrl:'https://image.chenjianfeng.xyz/20180904140847.png',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      AlbumGuid: options.AlbumGuid,
    })
    // this.getEWMUrl()
  },
  getEWMUrl:function(){
    var that = this
    wx.request({
      url: app.globalData.ServiceUrl + 'qiniufile/GetEWMxcx', //接口地址
      method: 'POST',
      data: {
        ValidateData: app.globalData.ValidateData,
        paras: {
          scene: this.data.AlbumGuid,
          page: "pages/album/album"
        }
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success: function (res) {
        console.log(res.data)
        if (res.data.BusinessInfo.Code == 1 && res.data.ReturnInfo.Code == 1) {
          that.setData({
            EwmUrl: res.data.UserArea.ewmUrl,
          })
        } else {
          that.showToast('图片获取失败');
        }
      }
    })
  },
  onShareAppMessage: function (res) {
    return {
      title: '来看看我的照片',
      path: 'pages/album/album?AlbumGuid=' + this.data.AlbumGuid,
      imageUrl: 'https://image.chenjianfeng.xyz/20180904140847.png',
    }
  }
})